import { AllowAnon } from '@/decorators/allow-anon.decortors';
import { Controller, Get, Query } from '@nestjs/common';
import { OssService } from './oss.service';

@Controller('oss')
export class OssController {
  constructor(private ossService: OssService) {}

  @Get('/upload')
  @AllowAnon()
  // 装饰器
  // 前端请求的时候 携带token
  async upload() {
    // controller --> service --> repository 实现增删改查
    return this.ossService.upload();
  }
  // GET /oss/test/api
  @Get('/test/api')
  // 不加token就可以请求接口
  @AllowAnon()
  async testApi(@Query() params) {
    // controller --> service --> repository 实现增删改查
    return this.ossService.testApi(params);
  }
}
